Helpful Information
 
 
Category: Several Different Masters
Several Different Masters -> Single Slave Replication?

I want to replication multiple master mysql databases on different hosts to one single slave host.

There doesn't seem to be anything in the MySQL Reference manual on this.

It's my guess that this would require multiple database instances, each with their own datadir on the slave host?

To be clear, what I am talking about is NOT multi-master replication, but actually having separate distinct master databases doing completely different things, but having replicas running on one single host system.

So you have to different databases (different servers I assume) that you want to replicate on 1 other machine?

You simply need to enable replication for each, assuming they don't have the same database names.

Running separate mysql instances is the way to solve that.

To be able to run separate instances on the same machine you will have to create different my.cnf files for each instance where you also will have to specify different TCP ports and different datadirs since the different instances can't run against the same physical DB files.

Here you have an example of things that need to be different on each instance:


[mysqld]
datadir=/var/lib/mysqlx5
port=3305

[mysqld_safe]
open-files-limit = 8192
pid-file=/var/run/mysqld/mysqldx5.pid


Apart from this you only have to copy and change your startup script so that it uses the correct my.cnf file for each instance that you start.

that's exactly what I thought, thanks for confirming...










privacy (GDPR)